﻿using LSFTP.model;
using Rainbow.model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Rainbow.view
{
    public class BaseFileInfoViewModel : ViewModelBase
    {
        public BaseFileInfoViewModel()
        {
            totalSize = "0";
            completed = "0";
            progress = 0;
            speed = "0";
            residue = "0";
            dateTime = DateTime.Now;
            status = "等待中";
        }

        public BaseFileInfoViewModel(FTPFileInfo item):this()
        {
            fileInfo = item;
        }

        private FTPFileInfo m_fileInfo;
        public FTPFileInfo fileInfo
        {
            get { return m_fileInfo; }
            set
            {
                m_fileInfo = value;
                if(value != null)
                {
                    name = value.Name;
                }
                NotifyPropertyChanged();
            }
        }

        private int m_index;
        public int index
        {
            get { return m_index; }
            set
            {
                m_index = value;
                NotifyPropertyChanged();
            }
        }

        private string m_name;
        public string name
        {
            get { return m_name; }
            set
            {
                m_name = value;
                NotifyPropertyChanged();
            }
        }

        private string m_totalSize;
        public string totalSize
        {
            get { return m_totalSize; }
            set
            {
                m_totalSize = value;
                NotifyPropertyChanged();
            }
        }

        private string m_completed;
        public string completed
        {
            get { return m_completed; }
            set
            {
                m_completed = value;
                NotifyPropertyChanged();
            }
        }

        private int m_progress;
        public int progress
        {
            get { return m_progress; }
            set
            {
                m_progress = value;
                progressStr = value + "%";
                NotifyPropertyChanged();
            }
        }

        private string m_progressStr;
        public string progressStr
        {
            get { return m_progressStr; }
            set
            {
                m_progressStr = value;
                NotifyPropertyChanged();
            }
        }

        private string m_speed;
        public string speed
        {
            get { return m_speed; }
            set
            {
                m_speed = value;
                NotifyPropertyChanged();
            }
        }

        private string m_residue;
        public string residue
        {
            get { return m_residue; }
            set
            {
                m_residue = value;
                NotifyPropertyChanged();
            }
        }

        private DateTime m_dateTiem;
        public DateTime dateTime
        {
            get { return m_dateTiem;}
            set
            {
                m_dateTiem = value;
                NotifyPropertyChanged();
            }
        }

        private string m_status;
        public string status
        {
            get { return m_status; }
            set
            {
                m_status = value;
                NotifyPropertyChanged();
            }
        }


        private string m_localPath;
        public string localPath
        {
            get { return m_localPath; }
            set
            {
                m_localPath = value;
                NotifyPropertyChanged();
            }
        }

        private string m_remotePath;
        public string remotePath
        {
            get { return m_remotePath; }
            set
            {
                m_remotePath = value;
                NotifyPropertyChanged();
            }
        }
    }
}
